/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function editshow()
{
    document.getElementById("ad-edit2").style.display="block";
}
function edithide()
{
 document.getElementById("ad-edit2").style.display="none";
}
function searchClear(id)
{
    
   if(document.getElementById(id).value==document.getElementById(id).defaultValue)
        document.getElementById(id).value="";

}
function searchText(id)
{

   if(document.getElementById(id).value=="")
   {
        document.getElementById(id).value=document.getElementById(id).defaultValue;
      
   }
}

function divmove(id){
    //document.scrollTop=0;
   if (id="B1"){

   document.getElementById('B8').focus()
   }
    
  //  document.getElementById('college_list').scrollTop=0;
}


function FindPosition(oElement)
{
  if(typeof( oElement.offsetParent ) != "undefined")
  {
    for(var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent)
    {
      posX += oElement.offsetLeft;
      posY += oElement.offsetTop;
    }
      return [ posX, posY ];
    }
    else
    {
      return [ oElement.x, oElement.y ];
    }
}
//
//function GetCoordinates(e)
//{
//
//  var PosX = 0;
//  var PosX = 0;
//  var ImgPos;
//  ImgPos = FindPosition(document.getElementById(e));
//  if (!e) var e = window.event;
//  if (e.pageX || e.pageY)
//  {
//    PosX = e.pageX;
//    PosY = e.pageY;
//  }
//  else if (e.clientX || e.clientY)
//    {
//      PosX = e.clientX + document.body.scrollLeft
//        + document.documentElement.scrollLeft;
//      PosY = e.clientY + document.body.scrollTop
//        + document.documentElement.scrollTop;
//    }
//  PosX = PosX - ImgPos[0];
//  PosY = PosY - ImgPos[1];
//  document.getElementById("x").innerHTML = PosX;
//  document.getElementById("y").innerHTML = PosY;
// document.getElementById('college_list').scrollTop=PosY;
//}

 function openAjaxConfirm() {
      Dialog.alert({ url:"modelwindow/modelwindow_view_university/", options: {method: 'get'}},
                     {top: 0, width:380, className: "alphacube", okLabel: "Close", cancelLabel:"No"})
  }

  function openAjaxConfirm1() {
      Dialog.alert({ url:"post/page1", options: {method: 'get'}},
                     {top: 0, width:665, height:800, className: "alphacube", okLabel: "Close", cancelLabel:"No"})
  }

  function openSave(id) {
      Dialog.alert({ url:"../save_advertisment/"+id, options: {method: 'get'}},
                    {top: 0, width:420, height:195, className: "alphacube", okLabel: "Close", cancelLabel:"No"})
  }
  
  function openReportAbuse(id) {
      Dialog.alert({ url:"../report_abuse/"+id, options: {method: 'get'}},
                    {top: 0, width:420, height:340, className: "alphacube", okLabel: "Close", cancelLabel:"No"})
  }
  function openEmailFriend(id) {
      Dialog.alert({ url:"../email_friend/"+id, options: {method: 'get'}},
                    { top: 0, width:420, height:349, className: "alphacube", okLabel: "Close", cancelLabel:"No"})
  }
  function show_sample_text(id){
     document.getElementById(id).style.visibility ='visible';
  }

  function hide_sample_text(id){
      document.getElementById(id).style.visibility ='hidden';
  }

  function openAjaxConfirm2(id) {
      Dialog.alert({ url:"modelwindow/forcategory_view_university?id="+id, options: {method: 'get'}},
                     {top: 0, width:360, className: "alphacube", okLabel: "Close", cancelLabel:"No"})
  }

  function openAjaxConfirmSearch(keyword) {
      Dialog.alert({ url:"modelwindow/search_view_university?keyword="+keyword, options: {method: 'get'}},
                     {top: 0, width:360, className: "alphacube", okLabel: "Close", cancelLabel:"No"})
  }





   function change_user_field_values(field,value){
        if (field==1){
            document.getElementById('fullname').innerHTML='<input type="text" name="fullname_text" id="fullname_text" value="'+value+'">';
            document.getElementById('fullname_change').style.display='none';
            document.getElementById('fullname_update').style.display='block';
        }
        if (field==2){
            document.getElementById('email').innerHTML='<input type="text" name="email_text" id="email_text" value="'+value+'">';
            document.getElementById('email_change').style.display='none';
            document.getElementById('email_update').style.display='block';
        }
        if (field==3){
            document.getElementById('mobile').innerHTML='<input type="text" name="mobile_text" id="mobile_text" value="'+value+'">';
            document.getElementById('mobile_change').style.display='none';
            document.getElementById('mobile_update').style.display='block';
        }
        if (field==4){
            document.getElementById('university').innerHTML='<input type="text" name="university_text" id="university_text" value="'+value+'">';
            document.getElementById('university_change').style.display='none';
            document.getElementById('university_update').style.display='block';
        }

    }

function showdiv(id)
{
    
    x = document.getElementById(id);

	if (x.style.display == 'none')
	{
		x.style.display = 'block';
    }
    else
    {
		x.style.display = 'none';
	}
}


function refine_college_search()
{
    document.getElementById("filter").value=document.getElementById("college_search").value
    document.university.onsubmit();
}










/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/* Script by: www.jtricks.com
 * Version: 20071127
 * Latest version:
 * www.jtricks.com/javascript/navigation/fixed_menu.html
 */
